#include<stdio.h>
#include<string.h>
#define max(a,b) a>=b?a:b
void reserve(char*a)
{   int b=strlen(a);
    for (size_t i = 0; i < b/2; i++)
    {   char tepm;
        tepm=a[i];
        a[i]=a[b-i-1];
        a[b-i-1]=tepm;
    }
    
    
}
char* addBinary(char* a, char* b) {
    int len=max(strlen(a),strlen(b));
    char*c[len+2];
    int carry=0;
    char d[len+1];
    reserve(a);
    reserve(b);
    if (strlen(a)>=strlen(b))
    {for (size_t i = 0; i < strlen(b); i++)
    {
        d[i]=b[i];
    }
    d[len-1]='0';
    d[len]='\0';
    }
    if (strlen(a)<strlen(b))
    {for (size_t i = 0; i < strlen(b); i++)
    {
        d[i]=b[i];
    }
    d[len]='0';
    d[len+1]='\0';
    }
    for(int i=0;i<=len;i++)
    {
       if (strcmp(a,b))
       {
                /* code */
       }
       
    }
        c[len]=carry+'0';
        c[len+2]='\0';
        reserve(c);
        return c;
}
int main()
{
    char a[]="110";
    char b[]="11";
    printf("%s\n",addBinary(a,b));
}